<template>
    <div id="MapList">
      <header class="header">
        <div class="title">
          <img src="../../assets/images/01_11.png" alt="" class="img_zuo" @click="back" />
          <div>{{dataObj.taskName}}工作总结</div>
        </div>
      </header>

      <div class="box">
        <div class="box-head">
          <span>{{dataObj.dwTop}}:&nbsp;</span>
        </div>
        <div class="box-body">
          {{dataObj.detail}}&nbsp;
        </div>
      </div>

      <div class="box">
        <div class="box-head">
          <span>工作落实</span>
        </div>
        <div class="box-body">
          {{dataObj.gzls}}&nbsp;
        </div>
      </div>

      <div class="big-box">
        <div class="wcnr-list">

          <div class="list-item" v-for="(item,index) of dataObj.list" @click="openXq(item)">
            <div class="list-icon">
              <div class="icon"><img src="../../assets/images/rw_l.png" /></div>
              <div class="list-line" v-show="index<(dataObj.list.length-1)"></div>
            </div>
            <div class="list-item-content">
              <div class="list-item-head">
                <span class="time">{{getDateFormat(item.time,'M月D日')}}&nbsp;</span>
                <div class="type">
                  <!--<img v-show="item.type=='工作部署'" src="../../assets/images/rwjb_work.png" />
                  <img v-show="item.type=='专项整治'" src="../../assets/images/rwjb_resource.png" />-->
                  <img v-show="item.type=='巡查排查'" src="../../assets/images/logo5.png" />
                  <img v-show="item.type!='巡查排查'" src="../../assets/images/rwjb_work.png" />
                  {{item.type}}&nbsp;
                </div>
                <div class="people">
                  <img src="../../assets/images/rwjb_man.png" />
                  {{jiequ(item.people,10,'…')}}&nbsp;
                </div>
              </div>
              <button class="list-item-body">
                <img v-show="item.imgUrl" :src="show_path+item.imgUrl.split(',')[0]" />
                <div v-show="!item.imgUrl" class="blank"></div>
                <div class="item-text">{{item.title}}&nbsp;</div>
              </button>
            </div>
          </div>

        </div>
        <div class="big-box-end">
          <div class="end">
            <div>{{dataObj.dwDown}}&nbsp;</div>
            <div>{{getDateFormat(dataObj.time,'YYYY年M月D日')}}&nbsp;</div>
          </div>
        </div>
      </div>


    </div>
</template>
<script>
import { Dialog } from 'vant';
import utils from "../../assets/js/utils.js"
export default {
    name: "gzzj",
    data(){
        return{
          dataObj:{},
          show_path:null,
          taskSpecialId:null,//具体任务id
          theNewTaskAssignId:null,//专项任务id
          dwId:null
        }
    },
    methods:{
      back(){//返回
        // this.$router.push("/table_listtwo");
        this.$router.back()
      },
      openXq(item){//打开详情
        console.log(item.type)
        if(item.type=='巡查排查'){
        this.$router.push({path: '/gzzj'});
           sessionStorage.setItem("inspection_patrolTroubleshootId", item.id)
        sessionStorage.setItem("inspection_infoId", item.infoId)
        if (item.id!== 0) {
console.log(99999999)

          this.$router.push("/hard_detail");
        } else if (item.id == 0||item.id==null){
          this.$router.push({
            path: '/ptlook',
            query: { id: item.noweInfoId, ids: 14 }
          });
        }
          // sessionStorage.setItem("inspection_patrolTroubleshootId",item.id)
          // sessionStorage.setItem("inspection_infoId", item.infoId);
          // localStorage.setItem("hard_detail_from",'/gzzj');
          // this.$router.push("/hard_detail");
        }else{
          let kfc = { id: item.id, lujing: 'gzzj' };
          sessionStorage.setItem('todetail',JSON.stringify(kfc));
          this.$router.push({
            path: '/xcbs_detail'
          });
        }
      },
      getDateFormat(any_date,format){//日期格式化
        return utils.dateFormat(any_date,format);
      },
      jiequ(str,num,tail){//截取字符串
        tail = tail?(''+tail):'';
        if((str||str===0)&&str.length>num){
          str = str.substring(0,num)+tail;
        }
        return str;
      },
      //初始化
      init(){
        var _this = this;
        var params = {
          taskSpecialId:_this.taskSpecialId,//具体任务id
          theNewTaskAssignId:_this.theNewTaskAssignId,//专项任务id
          dwId:_this.dwId//单位id
        };
        try{
          plus.nativeUI.showWaiting("正在加载...");
        }catch(e){
          console.log(e.message);
        }
        _this.axios.get(_this.$global_msg.Url.host + "/taskAssign/workSummary",{
        	params:params
        }).then(function (data) {
          try{
            plus.nativeUI.closeWaiting();
          }catch(e){
            console.log(e.message);
          }
          console.log('taskAssign/workSummary:',data);
          if(data&&data.data){
            if(data.data.code==200){
              _this.dataObj = data.data.rows;
            }else{
              _this.$toast(data.data.msg);
            }
          }else{
            _this.$toast('查询失败');
          }
        });
      },
      plusReady: function () {

      },
    },
    beforeCreate() {
      document.addEventListener("plusready", this.plusReady, false);
    },
    mounted() {
      var _this = this;
      this.taskSpecialId = localStorage.getItem("rwjb_taskSpecialId");
      this.theNewTaskAssignId = localStorage.getItem("rwjb_theNewTaskAssignId");
      this.dwId = localStorage.getItem("rwjb_dwId");
      this.show_path = this.$global_msg.Url.hosts+'';
      this.init();

      //物理返回
      // window.addEventListener("popstate", function(){
      //   _this.back();
      // }, false);
    },
}
</script>
<style scoped>
  #MapList{
    width: 100%;
    height: 100%;
    z-index: 40;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    background-color: #f7f7f9;
  }
  .header {
    height: 1.8519rem;
    background: #007aff;
    padding-top: 0.8333rem;
    box-sizing: border-box;
    width: 100%;
    font-size: 0.388888rem;
    position: relative;
  }

  .title {
    padding: 0 0.3704rem;
    display: flex;
    align-items: center;
    color: #fff;
  }

  .title>div {
    width: 100%;
    font-size: 0.4444rem;
    text-align: center;
  }

  .img_zuo {
    width: 0.2593rem;
    height: 0.463rem;
  }
  .btn-search{
    position: absolute;
    right: 0.407407rem;
    /*bottom: 0.388888rem;*/
    width: 0.5rem;
    height: 0.5rem;
  }
  .btn-add{
    position: absolute;
    right: 0.37037rem;
    font-size: 1.111111rem !important;
  }




  /* 列表 */
  .box{
    width: 100%;
    height: auto;
    background-color: #FFFFFF;
    border-radius: 0.148148rem;
    margin-top: 0.148148rem;
  }
  .box .box-head{
    width: auto;
    height: 0.879629rem;
    margin-left: 0.129629rem;
    margin-right: 0.218518rem;
    border-bottom: 1px #DDDDDD solid;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  .box .box-head span{
    margin-left: 0.37037rem;
  }
  .box .box-body{
    width: auto;
    margin-left: 0.129629rem;
    margin-right: 0.218518rem;
    padding-left: 0.24074rem;
    padding-top: 0.333333rem;
    padding-bottom: 0.351851rem;
    text-indent:2em;
    text-align: left;
  }


  .big-box{
    background-color: #FFFFFF;
    border-radius: 0.148148rem 0.148148rem 0 0;
    flex: 1;
    margin-top: 0.148148rem;
    display: flex;
    flex-direction: column;
    overflow: scroll;
  }
  .big-box .wcnr-list{
    flex: 1;
    margin-top: 0.425925rem;
    margin-left: 0.37037rem;
    margin-right: 0.296296rem;
    width: auto;
    overflow-x: hidden;
    overflow-y: scroll;
  }
  .big-box .wcnr-list::-webkit-scrollbar {/*隐藏滚轮*/
    display: none;
  }
  .big-box .wcnr-list .list-item{
    width: 100%;
    height: auto;
    display: flex;
  }
  .big-box .wcnr-list .list-item .list-icon{
    width: 0.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
  }
  .big-box .wcnr-list .list-item .list-icon .icon{
    margin-top: 0.296296rem;
    z-index: 11;
    background-color: #FFFFFF;
    width: auto !important;
    height: auto !important;
  }
  .big-box .wcnr-list .list-item .list-icon .icon img{
    width: 0.407407rem;
    height: 0.407407rem;
  }
  .big-box .wcnr-list .list-item .list-icon .list-line{
    height: 100%;
    width: 100%;
    position: absolute;
    left: 0.203703rem;
    top: 0.296296rem;
    border-left: 1px #0430ed solid;
    z-index: 10;
  }
  .big-box .wcnr-list .list-item .list-item-content{
    flex: 1;
  }
  .big-box .wcnr-list .list-item .list-item-content .list-item-head{
    width: 100%;
    display: flex;
    margin-top: 0.185185rem;
  }
  .big-box .wcnr-list .list-item .list-item-content .list-item-head .time{
    margin-left: 0.055555rem;
  }
  .big-box .wcnr-list .list-item .list-item-content .list-item-head .type{
    display: flex;
    align-items: center;
    margin-left: 0.148148rem;
  }
  .big-box .wcnr-list .list-item .list-item-content .list-item-head .type img{
    width: 0.407407rem;
    height: 0.388888rem;
    margin-right: 0.111111rem;
  }
  .big-box .wcnr-list .list-item .list-item-content .list-item-head .people{
    display: flex;
    align-items: center;
    margin-left: 0.222222rem;
  }
  .big-box .wcnr-list .list-item .list-item-content .list-item-head .people img{
    width: 0.407407rem;
    height: 0.388888rem;
    margin-right: 0.111111rem;
  }
  .big-box .wcnr-list .list-item .list-item-content .list-item-body{
    width: 100%;
    border: 2px #0430ed solid;
    display: flex;
    border-radius: 0.148148rem;
    margin-top: 0.185185rem;
    background-color: #fefefe;
  }
  .big-box .wcnr-list .list-item .list-item-content .list-item-body img,.big-box .wcnr-list .list-item .list-item-content .list-item-body .blank{
    width: 2.592592rem;
    height: 2.129629rem;
    margin-left: 0.111111rem;
    margin-top: 0.092592rem;
    margin-bottom: 0.092592rem;
    margin-right: 0.259259rem;
  }
  .big-box .wcnr-list .list-item .list-item-content .list-item-body .item-text{
    flex: 1;
    height: 100%;
    text-indent: 2em;
    text-align: left;
    margin-top: 0.203703rem;
    margin-bottom: 0.203703rem;
    font-size: 0.333333rem;
    color: #333333;
  }


  .big-box .big-box-end{
    width: 100%;
    height: 2.222222rem;
    display: flex;
    justify-content: flex-end;
  }
  .big-box .big-box-end .end{
    margin-right: 0.37037rem;
    padding-top: 0.222222rem;
    position: relative;
    right: -0.203703rem;
  }
  .big-box .end div{
    width: 100%;
    text-align: center;
  }


</style>
